fix(ui): scope model selection to activated provider during onboarding#2691
Open
tusharmath wants to merge 2 commits intomainfrom
Open
fix(ui): scope model selection to activated provider during onboarding#2691tusharmath wants to merge 2 commits intomainfrom
tusharmath wants to merge 2 commits intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Scope model selection to the activated provider during onboarding, so users can only pick a model belonging to the provider they just enabled.
Context
During onboarding, after a user selects and activates a provider, the subsequent model-selection step previously showed models from all configured providers. This meant a user could accidentally select a model that belongs to a different (possibly unconfigured) provider, leading to confusing failures at runtime. This change tightens the flow so that immediately after a provider is activated the model list is filtered to that provider only.
Additionally, this PR simplifies the
fs_patchrange-calculation logic by using a detected line-ending style uniformly (removing per-line\r\ndetection), removes the now-redundant out-of-bounds range error variant and its guard, and fixes a macOS Nix flake build by referencing individual Apple SDK frameworks instead of the monolithicpkgs.apple-sdk.Changes
provider_filter: Option<ProviderId>parameter toselect_modelandon_model_selectionincrates/forge_main/src/ui.rs.on_provider_activated), both the "no model set" and "current model no longer available" paths now callon_model_selection(Some(provider.id.clone())), restricting the list to the newly activated provider./modelslash-command and the standalone model-selection path continue to callon_model_selection(None), preserving the current behaviour of showing all providers.fs_patch.rs: detect line-ending style once (\r\nvs\n) and apply it uniformly, removing the per-segment\r\ndetection and theRangeOutOfBoundserror variant.fs_patch.rs.pkgs.apple-sdkwith explicitAppKit,CoreGraphics, andFoundationframework references inflake.nix.jobs/**entry from.gitignore.Key Implementation Details
select_modelnow acceptsOption<ProviderId>. WhenSome(id)is passed, aretaincall filtersall_provider_modelsto entries wherepm.provider_id == idbefore the interactive selection list is built. WhenNoneis passed, the list is unchanged — exactly the existing behaviour. The change is additive and backward-compatible; all existing call-sites passNoneexcept the two onboarding paths that now pass the activated provider's id.Testing
To exercise the onboarding flow manually:
/providerand activate a provider (e.g. Anthropic)./modelfrom the main prompt and confirm all providers are shown as before.